package homework.day03;

import java.util.*;

/**
 * 生成10个0-100的随机数并存入一个List集合中并输出
 * 之后将集合第3到第6个元素翻转并输出
 * 
 * @author Xiloer
 *
 */
public class Test04 {
    public static void main(String[] args) {
        Random random = new Random();
        List<Integer> list = new ArrayList<>();
        while (list.size()<10){
            list.add(random.nextInt(101));
        }
        System.out.println(list);

        List<Integer> subList = list.subList(2,6);
        System.out.println(subList);

        Collections.reverse(subList);

        System.out.println(subList);

    }
}
